#include <QCoreApplication>

#include "Core/Cell.hpp"
#include "Core/RuleData.hpp"

#include <QtCore/QDebug>

int main( int argc, char *argv[] )
{
    QCoreApplication a( argc, argv );

    Cell c1, c2;

    c1.addNeighbour( &c2 );
    c2.addNeighbour( &c1 );

    RuleData rules;
    rules.addSurvivalCondition( 1u );
    rules.addBirthCondition( 1u );

    c1.setLifeRules( &rules );
    c2.setLifeRules( &rules );

#ifdef QT_DEBUG
    c1.setCurrentStatus( Cell::Alive );
    c2.setCurrentStatus( Cell::Dead );
#endif

    qDebug() << "c1 status" << c1.currentStatus();
    qDebug() << "c2 status" << c2.currentStatus();

    c1.computeFutureStatus();
    c2.computeFutureStatus();

    qDebug() << "c1 future status" << c1.futureStatus();
    qDebug() << "c2 future status" << c2.futureStatus();

    c1.evolve();
    c2.evolve();

    qDebug() << "---- Evolving ----";

    qDebug() << "c1 status" << c1.currentStatus();
    qDebug() << "c2 status" << c2.currentStatus();

    c1.computeFutureStatus();
    c2.computeFutureStatus();

    c1.evolve();
    c2.evolve();

    qDebug() << "---- Evolving ----";

    qDebug() << "c1 status" << c1.currentStatus();
    qDebug() << "c2 status" << c2.currentStatus();
    
    return a.exec();
}
